using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._AttributeRules
{
    /// <summary>
    /// <para>Evaluate Rules</para>
    /// <para>Evaluates geodatabase rules and functionality.</para>
    /// <para>评估地理数据库规则和功能。</para>
    /// </summary>    
    [DisplayName("Evaluate Rules")]
    public class EvaluateRules : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public EvaluateRules()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_workspace">
        /// <para>Input Workspace</para>
        /// <para>A file geodatabase or feature service URL. An example of a feature service URL is https://myserver/server/rest/services/myservicename/FeatureServer.</para>
        /// <para>文件地理数据库或要素服务 URL。要素服务 URL 的一个示例是 https://myserver/server/rest/services/myservicename/FeatureServer。</para>
        /// </param>
        /// <param name="_evaluation_types">
        /// <para>Evaluation Types</para>
        /// <para><xdoc>
        ///   <para>Specifies the types of evaluation that will be used.</para>
        ///   <bulletList>
        ///     <bullet_item>Calculation rules—Batch calculation attribute rules will be evaluated.</bullet_item><para/>
        ///     <bullet_item>Validation rules—Validation attribute rules will be evaluated.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将使用的评估类型。</para>
        ///   <bulletList>
        ///     <bullet_item>计算规则—将评估批处理计算属性规则。</bullet_item><para/>
        ///     <bullet_item>验证规则—将评估验证属性规则。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public EvaluateRules(object _in_workspace, List<object> _evaluation_types)
        {
            this._in_workspace = _in_workspace;
            this._evaluation_types = _evaluation_types;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Evaluate Rules";

        public override string CallName => "management.EvaluateRules";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_workspace, _evaluation_types, _extent, _run_async.GetGPValue(), _updated_workspace];

        /// <summary>
        /// <para>Input Workspace</para>
        /// <para>A file geodatabase or feature service URL. An example of a feature service URL is https://myserver/server/rest/services/myservicename/FeatureServer.</para>
        /// <para>文件地理数据库或要素服务 URL。要素服务 URL 的一个示例是 https://myserver/server/rest/services/myservicename/FeatureServer。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_workspace { get; set; }


        /// <summary>
        /// <para>Evaluation Types</para>
        /// <para><xdoc>
        ///   <para>Specifies the types of evaluation that will be used.</para>
        ///   <bulletList>
        ///     <bullet_item>Calculation rules—Batch calculation attribute rules will be evaluated.</bullet_item><para/>
        ///     <bullet_item>Validation rules—Validation attribute rules will be evaluated.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将使用的评估类型。</para>
        ///   <bulletList>
        ///     <bullet_item>计算规则—将评估批处理计算属性规则。</bullet_item><para/>
        ///     <bullet_item>验证规则—将评估验证属性规则。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Evaluation Types")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _evaluation_types { get; set; }


        /// <summary>
        /// <para>Extent</para>
        /// <para><xdoc>
        ///   <para>The extent to be evaluated. If there is a selection in the map, only selected features within the specified extent will be evaluated.</para>
        ///   <bulletList>
        ///     <bullet_item>Default—The extent will be based on the maximum extent of all participating inputs. This is the default.</bullet_item><para/>
        ///     <bullet_item>Union of Inputs—The extent will be based on the maximum extent of all inputs.</bullet_item><para/>
        ///     <bullet_item>Intersection of Inputs—The extent will be based on the minimum area common to all inputs.</bullet_item><para/>
        ///     <bullet_item>Current Display Extent—The extent is equal to the visible display. The option is not available when there is no active map.</bullet_item><para/>
        ///     <bullet_item>As Specified Below—The extent will be based on the minimum and maximum extent values specified.</bullet_item><para/>
        ///     <bullet_item>Browse—The extent will be based on an existing dataset.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要评估的范围。如果地图中存在选择，则仅评估指定范围内的选定要素。</para>
        ///   <bulletList>
        ///     <bullet_item>默认值 - 范围将基于所有参与输入的最大范围。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>输入并集 - 范围将基于所有输入的最大范围。</bullet_item><para/>
        ///     <bullet_item>输入交点 - 范围将基于所有输入共有的最小面积。</bullet_item><para/>
        ///     <bullet_item>当前显示范围 - 范围等于可见显示。当没有活动地图时，该选项不可用。</bullet_item><para/>
        ///     <bullet_item>如下所述 - 范围将基于指定的最小和最大范围值。</bullet_item><para/>
        ///     <bullet_item>浏览 - 范围将基于现有数据集。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extent")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _extent { get; set; } = null;


        /// <summary>
        /// <para>Async</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the evaluation will run synchronously or asynchronously. This parameter is only supported when the input workspace is a feature service.
        ///   <bulletList>
        ///     <bullet_item>Checked—The evaluation will run asynchronously. This option dedicates server resources to run the evaluation with a longer time-out. Running asynchronously is recommended when evaluating large datasets that contain many features requiring calculation or validation. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—The evaluation will run synchronously. This option has a shorter time-out and is best used when evaluating an extent with a small number of features requiring calculation or validation.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定评估是同步运行还是异步运行。仅当输入工作空间为要素服务时，才支持此参数。
        ///   <bulletList>
        ///     <bullet_item>选中 - 评估将异步运行。此选项将服务器资源专用于运行具有较长超时时间的评估。在评估包含许多需要计算或验证的特征的大型数据集时，建议异步运行。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>未选中 - 评估将同步运行。此选项的超时时间较短，在评估具有少量需要计算或验证的要素的范围时，此选项最适合使用。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Async")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _run_async_value _run_async { get; set; } = _run_async_value._true;

        public enum _run_async_value
        {
            /// <summary>
            /// <para>ASYNC</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ASYNC")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>SYNC</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SYNC")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Workspace</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _updated_workspace { get; set; }


        public EvaluateRules SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}